package com.ruoyi.omp.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.omp.api.domain.FeLeaseRecord;
import com.ruoyi.omp.api.domain.NyCheckMeter;
import com.ruoyi.omp.api.domain.NyMeterAccount;
import com.ruoyi.omp.api.domain.vo.EnterpriseVo;
import com.ruoyi.omp.api.domain.vo.NyCheckMeterVO;
import com.ruoyi.omp.api.factory.RemoteCheckMeterFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author: cjie
 * @description: 抄表记录服务
 * @date: 2021/8/16
 */
@FeignClient(contextId = "remoteCheckMeterService", value = ServiceNameConstants.OMP_ENERGY_SERVICE, fallbackFactory =
        RemoteCheckMeterFactory.class)
public interface RemoteCheckMeterService {

    /**
     * 修改仪表分摊池
     * @param nyMeterAccount 仪表台账
     * @return
     */
    @PostMapping(value = "/nyMeterAccount/update")
    R updateNyMeterAccount(@RequestBody NyMeterAccount nyMeterAccount);

    /**
     * 查询仪表台账列表
     * @param nyMeterAccount 仪表台账
     * @return
     */
    @PostMapping(value = "/nyMeterAccount/listMeter")
    R<List<NyMeterAccount>> listMeter(@RequestBody NyMeterAccount nyMeterAccount);

    // 根据企业名称，费用周期，费用类型，查询抄表记录
    @PostMapping(value = "/nyCheckMeter/listCheck")
    R<List<NyCheckMeterVO>> listCheckMeter(@RequestBody NyCheckMeter nyCheckMeter);

    // 根据企业名称，费用周期，费用类型，查询抄表记录
    @PostMapping(value = "/nyCheckMeter/listCheckMonthShare")
    R<List<NyCheckMeterVO>> listCheckMonthShare(@RequestBody NyCheckMeter nyCheckMeter);


    /**
     * 计算私表汇总
     */
    @PostMapping(value = "/nyCheckMeter/compute/private")
    R<BigDecimal> computePrivateSummery(@RequestBody NyCheckMeter nyCheckMeter);


    /**
     * 查询抄表记录详情
     * @param recordId 记录id
     * @return
     */
    @GetMapping(value = "/nyCheckMeter/info/{recordId}")
    R<NyCheckMeter> getCheckMeter(@PathVariable("recordId") String recordId);

    /**
     * 修改抄表记录
     * @param nyCheckMeter 抄表记录
     * @return
     */
    @PostMapping(value = "/nyCheckMeter/updateCheckMeter")
    R updateCheckMeter(@RequestBody NyCheckMeter nyCheckMeter);



    /**
     * 查询企业信息
     * @param id 企业id
     * @return
     */
    @GetMapping( value = "/qyEnterprise/getEenterprise/{id}")
    R<EnterpriseVo> getEenterprise(@PathVariable("id") String id);

    @PostMapping(value = "/qyEnterprise/add")
    R addEenterprise(@RequestBody EnterpriseVo enterpriseVo);

    /**
     * 查询企业id
     * @param id 企业名称
     * @return
     */
    @GetMapping( value = "/qyEnterprise/name/{name}")
    R<String> getEenterpriseByName(@PathVariable("name") String name);

    /**
     * 查询园区是否汇总
     * param 园区编码，费用周期
     * @return
     */
    @GetMapping(value = "/nyCheckMeter/isCompleted")
    R<Boolean> getIsCompleted(NyCheckMeter nyCheckMeter);


}
